home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / osr5 / news / inn-2.0 / cntl / cqs
Text File  |  1998-07-26  |  908b  |  39 lines

  1. #!/bin/sh
  2.  
  3. CMT="InterNetNews Administrative Account" 
  4.  
  5. chknews() {
  6.     echo "ADD=1" > /tmp/chk$$
  7.     awk ' BEGIN { FS=":" } { print $1 } ' $1 | while read f
  8.     do
  9.         [ "$f" = "news" ] && echo "ADD=" > /tmp/chk$$
  10.     done
  11. }
  12.  
  13. addgrpnews() {
  14.     groupadd news
  15. }
  16.  
  17. addusrnews() {
  18.     useradd -g news -d /usr/local/news -s /bin/sh -c "$CMT" news
  19.     echo "Setting the password for the newly created 'news' user account."
  20.     passwd news
  21. }
  22.  
  23. chknews /etc/group
  24. . /tmp/chk$$
  25. [ "$ADD" ] && addgrpnews
  26. chknews /etc/passwd
  27. . /tmp/chk$$
  28. [ "$ADD" ] && {
  29.     addusrnews
  30.     echo "The installation of INN (InterNet News) may require additional"
  31.     echo "system specific configuration.\n"
  32.     echo "Do not forget to update your cron entries."
  33.     echo "Also run makehistory if you have to."
  34.     echo "Create/obtain an active file and run makehistory -o if"
  35.     echo "this is a first time install."
  36. }
  37. rm -f /tmp/chk$$
  38.  
  39.